package com.tianshi.order.feign.client;


import com.tianshi.order.feign.fallback.ProductFeignClientFallback;
import com.tianshi.vo.ProductVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


//远程调用，请求路径，写调用服务的名称，底层会自动实现负载均衡
//请求路径，写调用服务的名称，底层会自动实现负载均衡
@FeignClient(value = "service-product",fallback = ProductFeignClientFallback.class)
public interface ProductFeignClient {


    @GetMapping("/product/{productId}")
    ResponseEntity<ProductVO> getProductByProductId(@PathVariable("productId") Long productId);
}
